package cate.game.role.res.guild.msg.donate;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdGuild;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "公会捐献执行 の 请求")
@OperationSetter(value = GDOperation.GUILD_DONATE)
public class GuildDonateReq implements MsgInput {
    @NoteField(value = "捐献ID")
    public int id;

    @Override
    public MsgConfig conf() {
        return MsgIdGuild.GUILD_DONATE_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        if (!cc.getRole().getRes().guild.checkGuild().ok()) {
            game.notice.message(cc.getRole() ,310450,"尚未加入公会");
            return;
        }
//            cc.getRole().cur.op.setOperation(GDOperation.GUILD_DONATE);
        cc.getRole().getRes().guild.donate.donate(id);
//            cc.getRole().cur.op.clearOperation();
    }
}
